<?php
    /**
    * handler.php
    * 
    * @author Osuvaldo Ramos <xdracox@gmail.com>
    * @copyright Copyright (c) 2008, Osuvaldo Ramos
    * @license http://www.opensource.org/licenses/bsd-license.php
    * @package Atman
    */
    
    /**
    * Handles the display of errors when an error occurs.
    * @package Atman
    */
    class errorhandler extends AT_Module
    {
        /**
        * Gets the error message from the options parameter.
        * @param string $msg The error message.
        */
        public function __construct($msg)
        {
            parent::__construct('error');
            $this->set('message', $msg);
            $this->setView(AT_View::factory('smarty', $this));
        }
        
        /**
        * Does nothing.
        * @return void
        */
        public function __default()
        {
        }
        
        /**
        * Displays a warning page.
        * @return void
        */
        public function warning()
        {
            $this->setTplFile('warning.tpl');
        }
        
        public function error()
        {
            $this->setTplFile('error.tpl');
        }
        
        /**
        * __destruct()
        */
        public function _destruct()
        {
            parent::__destruct();
        }
    }
?>
